package mainpackage;

import java.awt.Frame;
import java.awt.TextArea;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;

public class ConsoleFrame extends Frame implements WindowListener {

	TextArea textArea;

	public ConsoleFrame(String title) {
		super(title);
		addWindowListener(this);
		setSize(350, 200);
		textArea = new TextArea();
		textArea.setEditable(false);
		add(textArea);
	}

	@Override
	public void windowActivated(WindowEvent arg0) {

	}

	@Override
	public void windowClosed(WindowEvent arg0) {

	}

	@Override
	public void windowClosing(WindowEvent arg0) {
		System.exit(0);
	}

	@Override
	public void windowDeactivated(WindowEvent arg0) {

	}

	@Override
	public void windowDeiconified(WindowEvent arg0) {

	}

	@Override
	public void windowIconified(WindowEvent arg0) {

	}

	@Override
	public void windowOpened(WindowEvent arg0) {

	}
	
	public void log(String string)
	{
		textArea.setText(textArea.getText()+string+"\n");
	}
}
